<template>
	<view class="u-p-20">
		<mescroll-body ref="mescrollRef" :bottombar="false" @init="mescrollInit" @down="downCallback" @up="upCallback">
			<view class="flex justify-between bg-white u-m-b-20 u-p-x-30 u-p-y-50 rounded-10" v-for="(item,index) in list" :key="index">
				<text class="u-font-26">{{item.content}}</text>
				<text class="u-font-26">{{item.updatetime}}</text>
			</view>
		</mescroll-body>
	</view>
</template>

<script>
	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	import { MineCenterApi } from '@/api/serves.js'
	export default {
		mixins: [MescrollMixin], // 使用mixin
		data() {
			return {
				list: []
			}
		},
		onLoad() {

		},
		methods: {
			// 上拉加载
			upCallback(page) {
				MineCenterApi.chougetlogs({ page: page.num}).then(res=> {
					console.log('获奖记录', res);
					if(res.code == 1){
						let result = res.data
						if(page.num == 1) this.list = []; //如果是第一页需手动制空列表
						this.list = this.list.concat(result.data); //追加新数据
						this.mescroll.endBySize(result.data.length, 0)
					}else {
						this.$Toast(res.msg)
						this.mescroll.endErr()
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>

</style>
